package top.zhmq.commonmodule.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;


/**
 * 商品实体类
 *
 * @author Glory
 * @classname Goods
 * @create 2021-06-01 08:36
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "shoptest")
public class Goods {
    @Id
    public int gid;
    @Field(type = FieldType.Keyword)//存储数据时候，不会分词建立索引
    public int gprice;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")//ik_max_word使用ik分词器
    public String gname;
    public String gdetails;
    @Field(type = FieldType.Keyword)//存储数据时候，不会分词建立索引
    private Integer types;
    @Field(index = false, type = FieldType.Keyword)//不建立索引
    private String gremain;
}
